<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>   
<%@ taglib prefix="elfunc" uri="/WEB-INF/tlds/el-functions.tld" %>
	<style>
	.bbs td div{
		margin:10px 10px;
		border:1px solid #D6D6D6;
		/* line-height:7px; */
	}
	.bbs td div th{
		border-bottom:1px solid #D6D6D6;
	}
	.bbs td div td{
		border-bottom:1px solid #D6D6D6;
	}
	</style>
	<script type="text/javascript">
	<!--
		
		var status = "${orderVo.status}";	
		$(function(){
			$("[name='status']").each(function(){
				if($(this).val() == status){
					$(this).attr({checked:true});
				}
			});
			$("[name='status']").click(function(){
				$.post('order_update.action', 
					  {
						statuss : $(this+":checked").val(),
						orderNo	: $("[name='orderNo']").val()
						
					  },
					  function(data){
						  console.log(data);
					  }
				);
				
			});
		});
		function del(){
			var f = document.writeForm;
			var answer = confirm("삭제 하시겠습니까?");
			if(answer){
				f.action = "order_delete.action";
				f.submit();
			}
		}
	//-->
	</script>
	<h3>뷰</h3>
	<form method="post" name="writeForm">
	<input type="hidden" name="orderNo" value="${orderVo.orderNo}"/>
	<table border="1" cellspacing="0" width="100%" class="bbs">
	<tbody>
		<tr>
			<th align="center" width="100">주문자 아이디</th>
			<td></td>
		</tr>
		<tr>
			<th align="center" width="100">주문상품 정보</th>
			<td>
				
				<div>
					<table width="100%">
					<tr>
						<th width="100">상품명</th>
						<th>이미지</th>
						<th width="100">색상</th>
						<th width="100">가격</th>
						<th width="100">주문수량</th>
					</tr>
					<c:forEach items="${list}" var="l">
					<tr>
						<td>${l.itemName}</td>
						<td><img src="/ssol2/upload/item/${l.fileName1}"  width="80"/></td>
						<td>${l.color}</td>
						<td>${l.price}</td>
						<td>${l.amount}</td>
					</tr>
					</c:forEach>
					</table>
				</div>
			</td>
		</tr>
		<tr>
			<th align="center" width="100">주문자 정보</th>
			<td>
				<div>
					<p>이름 : ${orderVo.order_Name}</p>
					<p>전화번호 : ${orderVo.order_Tel}</p>
					<p>휴대폰번호 : ${orderVo.order_Hp}</p>
					<p>이메일 : ${orderVo.order_Email}</p>
					<p>우편번호 : ${orderVo.order_Zipcode}</p>
					<p>주소 : ${orderVo.order_Addr1} ${orderVo.order_Addr2}</p>
				</div>
			</td>
		</tr>
		<tr>
			<th align="center" width="100">수취인 정보</th>
			<td>
				<div>
					<p>이름 : ${orderVo.rec_Name}</p>
					<p>우편번호 : ${orderVo.rec_Zipcode}</p>
					<p>주소 : ${orderVo.rec_Addr1} ${orderVo.rec_Addr2}</p>
					<p>전화번호 : ${orderVo.rec_Tel}</p>
					<p>휴대폰 : ${orderVo.rec_Hp}</p>
					<p>이메일 : ${orderVo.rec_Email}</p>
					<p>남긴말 : ${orderVo.recComment}</p>
				</div>
			</td>
		</tr>
		<tr>
			<th align="center" width="100">송금 정보</th>
			<td>
				<div>
					<p>${orderVo.deposit}</p>
					<p>${orderVo.bank}</p>				
				</div>
			</td>
		</tr>
		<tr>
			<th align="center" width="100">주문날짜</th>
			<td>${boardVo.buydate}</td>
		</tr>
		<tr>
			<th align="center" width="100">주문상태</th>
			<td>
				<input type="radio" name="status" value="0"/>주문접수
				<input type="radio" name="status" value="1"/>결제완료
				<input type="radio" name="status" value="2"/>상품준비중
				<input type="radio" name="status" value="3"/>발송완료
				<input type="radio" name="status" value="4"/>배송완료
			</td>
		</tr>
	</tbody>
	<tfoot>
		<tr>
			<td align="right" colspan="4">
				<!-- <input type="button" class="button" value="삭제" onclick="del();"/> -->
				<input type="button" class="button" value="목록" onclick="location.href='order.action?currentPage=${currentPage}'"/>
			</td>
		</tr>
	</tfoot>
	</table>
	</form>